<?php





class data_api {


	
    function index_main() {
        global $_G;
        $sql = make_sql();
		
/*
        $index = D(array('and'=>$sql['and'],'order'=>$sql['order'],'sort'=>$sql[sort]),
					array('size'=>$_G[setting][cate_page],'url'=>'/index.php?m=list'.$sql['url']));

        $remen = D(array('and'=>'','order'=>'sum DESC','limit'=>5));
        $index['remen'] = $remen;		
*/	
			$index  = array();
			if(!class_exists('api_goods'))include_once libfile('class/api_goods');
			$api_goods = new api_goods;
			$index = $api_goods->get(array('kw'=>'女 特价','size'=>48,'price1'=>5,'price2'=>500,'sort'=>'rand'),'m=index&a=all&kw=女 特价');
			$index['remen'] = $api_goods->get(array('kw'=>'女 促销','size'=>5,'price1'=>5,'price2'=>10,'sort'=>'rand'));


        return $index;
    }

    function  article() {
        global $_G;
        $list = array();

        foreach($_G['article_cate'] as $k=>$v){            
                $tmp = array();
                $tmp['name'] = $v['name'];
                $tmp['goods'] = D(array('and' => 'and cate = '.$v['id'], 'order' => 'id DESC', 'limit' => 8,'table'=>'article','cutstr'=>'title|20'));
                $list[] = $tmp;
        }
        return array('list'=>$list);

    }


  /*  function  goods_main(){
        global $_G,$assign;
        $xiangguan = top('tbk','get_recommend',1,$_GET['itemid'],20);
		$sid = $assign['goods']['sid'];

        return array('xiangguan'=>$xiangguan);

    }*/

}





?>